xfs: enhance dinode verifier
authorEric Sandeen <sandeen@sandeen.net>
Tue, 17 Apr 2018 06:06:53 +0000 (23:06 -0700)
committerRaspbian forward porter <root@raspbian.org>
Sat, 5 May 2018 11:51:50 +0000 (12:51 +0100)
commit2761e2dc07f713943cb8df83a6cf2d8ded38a9db
tree07bf6069965bc8a2e854951622511bda551989f1
parente0f7dc85893f770f9681baf87ab5b2702e718404
xfs: enhance dinode verifier

Add several more validations to xfs_dinode_verify:

- For LOCAL data fork formats, di_nextents must be 0.
- For LOCAL attr fork formats, di_anextents must be 0.
- For inodes with no attr fork offset,
  - format must be XFS_DINODE_FMT_EXTENTS if set at all
  - di_anextents must be 0.

Thanks to dchinner for pointing out a couple related checks I had
forgotten to add.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199377
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name xfs-enhance-dinode-verifier.patch
fs/xfs/libxfs/xfs_inode_buf.c